package CSV;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.net.URISyntaxException;

import javax.annotation.processing.FilerException;

public class CSV {
	
	private final static String Csv_Name ="Valeurs.csv";
	private final static String Csv_path ="src/CSV/";
	
	public CSV()
	{
		
		
	}
	
	public String[][] Recuperation_information() throws IOException, URISyntaxException
	{
		String[][] tabChaine = new String[8][];
		
		try
		{
			
		   File file = new File(getCsvPath()+getCsvName());
		   System.out.println(file.getAbsoluteFile());
		   BufferedReader fichier_source = new BufferedReader(new FileReader(file));
		   //System.out.println(new File(chemin).getAbsolutePath());
		   String chaine;
		   int i = 0;
		 
		   while((chaine = fichier_source.readLine())!= null)
		   {
		     tabChaine[i] = chaine.split(";");
		      i++;
		   }
		   fichier_source.close();                 
		}
		catch (FilerException e)
		{
		   System.out.println("Le fichier est introuvable !");
		}
		
		
		return tabChaine;
	}

	public static String getCsvPath() {
		return Csv_path;
	}

	public static String getCsvName() {
		return Csv_Name;
	}
	
}
